package com.ruoyi.file.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 文件信息对象 file_info
 *
 * @author rww
 * @date 2023-02-20
 */
public class FileInfo extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 文件ID */
    private Long id;



    /** 文件名称 */
    @Excel(name = "文件名称")
    private String fileName;

    /** 文件类型 */
    @Excel(name = "文件类型")
    private String fileExt;

    /** 文件大小 */
    @Excel(name = "文件大小")
    private Long fileSize;

    /** 存储bucket */
    @Excel(name = "存储bucket")
    private String bucket;
    /** uuid名称 */
    @Excel(name = "uuid名称")
    private String objectName;

    /** 文件地址 */
    @Excel(name = "文件地址")
    private String url;

    /** 文件标识 */
    @Excel(name = "文件标识")
    private String identifier;



    /** 上传人 */
    @Excel(name = "上传人")
    private Long uploadBy;

    /** 上传时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "上传时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date uploadTime;

    /** 版本号 */
    @Excel(name = "版本号")
    private String version;

    /** 历史版本id */
    @Excel(name = "历史版本id")
    private Long preVersionId;


    private Integer type;//文件类型：1文件夹   2：压缩文件   3：文件
    private Long pid;//上一级文件id
    private String ancestors;//祖级列表
    private Integer stage;//

    private Long datasetId;//dataset_id


    public static int type_dir = 1;
    public static int type_zip = 2;
    public static int type_file = 3;


    public static int stage_uploading = 10;
    public static int stage_unzip = 20;//解压缩中
    public static int stage_unzip_done = 30;//解压缩成功

    public static int stage_unzip_error= 40;//解压缩失败

    public static int stage_unknow_type= 50;//



    public static int stage_upload_error= 190;//上传失败
    public static int stage_upload_success= 200;//上传成功

    //////////////////////////////////////////////////////


    public Long getDatasetId() {
        return datasetId;
    }

    public void setDatasetId(Long datasetId) {
        this.datasetId = datasetId;
    }

    public Integer getStage() {
        return stage;
    }

    public void setStage(Integer stage) {
        this.stage = stage;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Long getPid() {
        return pid;
    }

    public void setPid(Long pid) {
        this.pid = pid;
    }

    public String getAncestors() {
        return ancestors;
    }

    public void setAncestors(String ancestors) {
        this.ancestors = ancestors;
    }

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }
    public void setUrl(String url)
    {
        this.url = url;
    }

    public String getUrl()
    {
        return url;
    }
    public void setFileName(String fileName)
    {
        this.fileName = fileName;
    }

    public String getFileName()
    {
        return fileName;
    }
    public void setFileExt(String fileExt)
    {
        this.fileExt = fileExt;
    }

    public String getFileExt()
    {
        return fileExt;
    }
    public void setFileSize(Long fileSize)
    {
        this.fileSize = fileSize;
    }

    public Long getFileSize()
    {
        return fileSize;
    }
    public void setBucket(String bucket)
    {
        this.bucket = bucket;
    }

    public String getBucket()
    {
        return bucket;
    }
    public void setIdentifier(String identifier)
    {
        this.identifier = identifier;
    }

    public String getIdentifier()
    {
        return identifier;
    }
    public void setObjectName(String objectName)
    {
        this.objectName = objectName;
    }

    public String getObjectName()
    {
        return objectName;
    }
    public void setUploadBy(Long uploadBy)
    {
        this.uploadBy = uploadBy;
    }

    public Long getUploadBy()
    {
        return uploadBy;
    }
    public void setUploadTime(Date uploadTime)
    {
        this.uploadTime = uploadTime;
    }

    public Date getUploadTime()
    {
        return uploadTime;
    }
    public void setVersion(String version)
    {
        this.version = version;
    }

    public String getVersion()
    {
        return version;
    }
    public void setPreVersionId(Long preVersionId)
    {
        this.preVersionId = preVersionId;
    }

    public Long getPreVersionId()
    {
        return preVersionId;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .append("remark", getRemark())
            .append("url", getUrl())
            .append("fileName", getFileName())
            .append("fileExt", getFileExt())
            .append("fileSize", getFileSize())
            .append("bucket", getBucket())
            .append("identifier", getIdentifier())
            .append("objectName", getObjectName())
            .append("uploadBy", getUploadBy())
            .append("uploadTime", getUploadTime())
            .append("version", getVersion())
            .append("preVersionId", getPreVersionId())
            .toString();
    }
}
